package com.frxuexi.adapter

import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.OrderBean
import com.frxuexi.lib_base.entity.PayInfo
import com.frxuexi.lib_base.http.GlideUtil
import com.frxuexi.shop.R

class OrderAdapter:BaseQuickAdapter<PayInfo,BaseViewHolder>(R.layout.item_order) {
    override fun convert(helper: BaseViewHolder, item: PayInfo) {
        val info = item.orderInfoList.get(0)

        GlideUtil.getRoundImg(info.image, helper.getView<ImageView>(R.id.order_iv))
        helper.setText(R.id.order_title,info.storeName)
        helper.setText(R.id.order_num,"×${info.cartNum}")
        helper.setText(R.id.order_price,"￥${info.price}")
        helper.setText(R.id.order_sum,"实付款：￥${item.payPrice}")
        helper.getView<TextView>(R.id.btn_order).apply {
//            when(item.status){
                setText(item.orderStatus)
//            }
        }

    }
}